<template>
  <div class="home">
    <!-- 因为发现页面被切换的时候重新发送请求获取数据很浪费性能，将第一次请求的数据进行缓存即可 -->
    <keep-alive include="find">
      <router-view></router-view>
    </keep-alive>
    <van-tabbar
      route
      active-color="#e40137"
      inactive-color="#b4b4bd"
      class="nav"
      v-if="$route.meta.needTab"
    >
      <van-tabbar-item class="item">
        <template #icon>
          <i class="iconfont iconicon_footbar_gs_nor"></i>
        </template>
        <span>公司</span></van-tabbar-item
      >
      <van-tabbar-item to="/question">
        <template #icon>
          <i class="iconfont iconicon_footbar_st_nor"></i>
        </template>
        刷题
      </van-tabbar-item>
      <van-tabbar-item to="/find">
        <template #icon>
          <i class="iconfont iconicon_footbar_fx_nor"></i>
        </template>
        发现</van-tabbar-item
      >
      <van-tabbar-item to="/my">
        <template #icon>
          <i class="iconfont iconicon_footbar_wode_sel"></i>
        </template>
        我的
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {}
</script>
<style lang="less" scoped>
.home {
  .nav {
    width: 100vw;
  }
  .iconfont {
    font-size: 28px;
  }
}
</style>
